// routes/ai.js
const express = require('express');
const router = express.Router();

// 引入认证中间件
const auth = require('../middleware/auth');

// 引入控制器
const { evaluateFeynmanAttempt, polishTranscribedText, generateQuestion, gradeAnswer } = require('../controllers/deepseekAiController');

// @route   POST /api/ai/evaluate
// @desc    AI评价用户回答
// @access  Private (需要登录)
router.post('/evaluate', auth, evaluateFeynmanAttempt);

// @route   POST /api/ai/polish
// @desc    AI润色转录文本
// @access  Private (需要登录)
router.post('/polish', auth, polishTranscribedText);

// @route   POST /api/ai/generate-question
// @desc    AI生成题目
// @access  Private (需要登录)
router.post('/generate-question', auth, generateQuestion);

// @route   POST /api/ai/grade-answer
// @desc    AI评分答案
// @access  Private (需要登录)
router.post('/grade-answer', auth, gradeAnswer);

module.exports = router;